# import sys
#
#
# def fibonacci(n):  # 生成器函数 - 斐波那契
#     a, b, counter = 0, 1, 0
#     while True:
#         if (counter > n):
#             return
#         yield a
#         a, b = b, a + b
#         counter += 1
#
#
# f = fibonacci(10)  # f是一个迭代器，由生成器返回生成，有next()方法
#
# while True:
#     try:
#         print(next(f), end=" ")
#     except StopIteration:
#         sys.exit()
info = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
a = [i+1 for i in info]
b = (i+1 for i in info)
print(type(a))
print(type(b))
print(next(b))
print(next(b))
print(next(b))

